package com.kb.design.common;

import lombok.Data;

@Data
public class ApiResponse {
    private int status;
    private String msg;
    private Object data;

    public ApiResponse(int status, String msg, Object data) {
        this.status = status;
        this.msg = msg;
        this.data = data;
    }

    // Getters and Setters

    // Optional: You can also add static methods to create common response objects.
    public static ApiResponse success(Object data) {
        return new ApiResponse(0, "成功", data);
    }

    public static ApiResponse successAndMsg(Object data,String  msg) {
        return new ApiResponse(0, msg, data);
    }

    public static ApiResponse error(String message) {
        return new ApiResponse(500, message, null);
    }
}
